<%@page import="com.zhuoshi.dao.PaymentDao"%>
<%@page import="com.zhuoshi.dao.ContractSubDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String numerical = request.getParameter("numerical");
String returnmoney = request.getParameter("returnmoney");

//计算出项目总金额(new ContractSubDao().getTotalMoney)   回款总金额（写了一个方法 可以直接用）paymentdao.getallpayment
ContractSubDao csDao = new ContractSubDao();
double csMoney = csDao.getTotalMoney(Integer.parseInt(numerical));//通过合同单号，从合同子表中获取这个单子的合同总额
PaymentDao payDao = new PaymentDao();
double payMoney = payDao.getAllPayment(Integer.parseInt(numerical));//通过合同单号，从回款表中获取这个单子一共回款了多少钱

double result = csMoney - payMoney; //合同的总金额-回款总金额  得出 最多还能回款多少钱，不能回多了 多了就丫的出bug了

if(Double.parseDouble(returnmoney)>result){
	response.getWriter().write("回款总金额大于合同总额");
}else{
	response.getWriter().write("回款总金额不大于合同总额");
}






%>
